@extends('layouts.admin')
@section('content')
    <!--面包屑导航 开始-->
    <div class="crumb_warp">
        <!--<i class="fa fa-bell"></i> 欢迎使用登陆网站后台，建站的首选工具。-->
        <i class="fa fa-home"></i> <a href="{{url('Admin/info')}}">首页</a> &raquo; <a href="{{url('Admin/config')}}">网站配置</a> &raquo; 添加配置
    </div>
    <!--面包屑导航 结束-->

	<!--结果集标题与导航组件 开始-->
	<div class="result_wrap">
        <div class="result_title">
            <h3>快捷操作</h3>
            @if(count($errors)>0)
            <div class="mark">
                @foreach($errors as $err)
                <p>{{$err}}</p>
                @endforeach
            </div>
            @endif
        </div>
        <div class="result_content">
            <div class="short_wrap">
                <a href="{{url('Admin/config')}}"><i class="fa fa-adjust"></i>配置列表</a>
            </div>
        </div>
    </div>
    <!--结果集标题与导航组件 结束-->
    
    <div class="result_wrap">
        <form action="{{url('Admin/config/'.$data->conf_id)}}" method="post" >
            {{csrf_field()}}
            <input  type="hidden" name="_method" value="put"/>
            <table class="add_tab">
                <tbody>
                    <tr>
                        <th><i class="require">*</i>配置标题：</th>
                        <td>
                            <input type="text" class="lg" style="max-width: 240px" name="conf_title" value="{{$data->conf_title}}">
                            <span><i class="fa fa-exclamation-circle yellow"></i>标题可以写30个字儿</span>
                        </td>
                    </tr>
                    <tr>
                        <th><i class="require">*</i>配置名称：</th>
                        <td>
                            <input type="text" name="conf_name" value="{{$data->conf_name}}">
                            <span><i class="fa fa-exclamation-circle yellow"></i>这里是默认长度</span>
                        </td>
                    </tr>
                    <tr>
                        <th>配置类型 </th>
                        <td>
                            input  <input type="radio" name="conf_type" value="1" @if($data->conf_type==1) checked="checked" @endif> &nbsp;&nbsp;
                            textarea  <input type="radio" name="conf_type" value="2" @if($data->conf_type==2) checked="checked" @endif> &nbsp;&nbsp;
                            radio  <input type="radio" name="conf_type" value="3" @if($data->conf_type==3) checked="checked" @endif>
                        </td>
                    </tr>

                    <tr id="conf_value">
                        <th>类型值</th>
                        <td>
                            <input type="text" name="conf_value" value="{{$data->conf_value}}">
                        </td>
                    </tr>

                    <tr>
                        <th>排序：</th>
                        <td>
                            <input type="text" class="sm" name="sort" value="{{$data->sort}}">
                            <span><i class="fa fa-exclamation-circle yellow"></i>这里是短文本长度</span>
                        </td>
                    </tr>
                    <tr>
                        <th>说明</th>
                        <td>
                            <textarea name="conf_desc" id="" cols="30" rows="10" >{{$data->conf_desc}}</textarea>
                        </td>
                    </tr>
                    <tr>
                        <th></th>
                        <td>
                            <input type="submit" value="提交">
                            <input type="button" class="back" onclick="history.go(-1)" value="返回">
                        </td>
                    </tr>
                </tbody>
            </table>

        </form>

    </div>
    <style>
        #conf_value{
            display: none;
        }
    </style>
    <script>
        $("input[name=conf_type]").click(function () {
            var val = $(this).val();
            if(val == 3){
               $("#conf_value").show();
            }else{
                $("#conf_value").hide();
            }
        })

    </script>
@endsection
